package com.laixu.proxy;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class Proxy implements Singer {
    // 通过Spring自动注入目标对象（实验2的依赖注入）
    @Autowired
    private Singer target;

    @Override
    public void sing() {
        // 代理类的增强逻辑
        System.out.println("安排时间");
        System.out.println("联系场地");
        System.out.println("安全保障");
        System.out.println("合同签订");
        System.out.println("费用结算");
        System.out.println("------------");

        // 调用目标对象的核心方法
        target.sing();
    }
}